@aigne/doc-smith 0.9.9-beta.1 → 0.9.9-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.9-beta.3](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.9.9-beta.2...v0.9.9-beta.3) (2025-12-11)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **diagram:** ensure accurate timestamp handling for images and generated content ([#360](https://github.com/AIGNE-io/aigne-doc-smith/issues/360)) ([b78f833](https://github.com/AIGNE-io/aigne-doc-smith/commit/b78f833bc413fb666b7481f4fa720d0656e0e1cc))
9
+
10
+ ## [0.9.9-beta.2](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.9.9-beta.1...v0.9.9-beta.2) (2025-12-11)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **core:** enhance data integrity and locale handling for improved reliability ([#358](https://github.com/AIGNE-io/aigne-doc-smith/issues/358)) ([db96031](https://github.com/AIGNE-io/aigne-doc-smith/commit/db9603182e19d57a155dcefee1e0b335efdaa244))
16
+
3
17
  ## [0.9.9-beta.1](https://github.com/AIGNE-io/aigne-doc-smith/compare/v0.9.9-beta...v0.9.9-beta.1) (2025-12-11)
4
18
 
5
19
 
@@ -52,7 +52,7 @@ export default async function addDocumentsToStructure(input = {}, options = {})
52
52
 
53
53
  await options.context.invoke(updateDocumentStructure, {
54
54
  ...input,
55
- dataSourceChunk: input.dataSources[0].dataSourceChunk,
55
+ dataSourceChunk: input.dataSources[0]?.dataSourceChunk || "",
56
56
  feedback,
57
57
  documentStructure: currentStructure,
58
58
  needDataSources: true,
@@ -83,7 +83,7 @@ export default async function userReviewDocumentStructure({ documentStructure, .
83
83
  // Call refineDocumentStructure agent with feedback
84
84
  const { message } = await options.context.invoke(refineAgent, {
85
85
  ...rest,
86
- dataSourceChunk: rest.dataSources[0].dataSourceChunk,
86
+ dataSourceChunk: rest.dataSources[0]?.dataSourceChunk || "",
87
87
  feedback: feedback.trim(),
88
88
  documentStructure: currentStructure,
89
89
  userPreferences,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigne/doc-smith",
3
- "version": "0.9.9-beta.1",
3
+ "version": "0.9.9-beta.3",
4
4
  "description": "AI-driven documentation generation tool built on the AIGNE Framework",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -15,7 +15,7 @@ Your task is to **update an existing diagram** based on the current document con
15
15
  - **Diagram Type:** {{ diagramType }}
16
16
  - **Visual Style:** {{ diagramStyle }} (maintain consistency with existing image unless feedback requests change)
17
17
  - **Aspect Ratio:** {{ aspectRatio }}
18
- - **Language:** English
18
+ - **Language:** {{ locale }}
19
19
 
20
20
  **Existing Diagram:**
21
21
  [The existing diagram image is provided as input to the model]
@@ -54,7 +54,7 @@ Please follow **all global rules, styles, aspect ratio logic, and diagram-type r
54
54
  - **Diagram Type:** {{ diagramType }}
55
55
  - **Visual Style:** {{ diagramStyle }}
56
56
  - **Aspect Ratio:** {{ aspectRatio }}
57
- - **Language:** English
57
+ - **Language:** {{ locale }}
58
58
 
59
59
  # Your responsibilities:
60
60
  1. Read and analyze the document content.
@@ -95,7 +95,7 @@ function parseGitignoreContent(content) {
95
95
  const lines = content
96
96
  .split("\n")
97
97
  .map((line) => line.trim())
98
- .filter((line) => line && !line.startsWith("#"))
98
+ .filter((line) => line && !line.startsWith("#") && line !== ".") // A standalone dot (.) in .gitignore is ineffective and should be removed.
99
99
  .map((line) => line.replace(/^\//, "")); // Remove leading slash
100
100
 
101
101
  // Convert each gitignore pattern to glob patterns
@@ -87,7 +87,7 @@ function extractDiagramImagesWithTimestamp(content) {
87
87
  images.push({
88
88
  type: match[1] || DEFAULT_DIAGRAM_TYPE, // Diagram type (e.g., "architecture", "guide")
89
89
  aspectRatio: match[2] || DEFAULT_ASPECT_RATIO, // Aspect ratio (e.g., "16:9", "4:3")
90
- timestamp: match[3] || null, // Timestamp (null for old format)
90
+ timestamp: (match[3] || "").replace(/^:/, ""), // Timestamp without leading colon (null for old format)
91
91
  altText: match[4] || DEFAULT_ALT_TEXT, // Alt text from markdown
92
92
  path: match[5] || "", // Image path
93
93
  fullMatch: match[0] || "", // Full matched block
@@ -229,7 +229,8 @@ function createImageMarkdown(diagramType, aspectRatio, timestamp, altText, image
229
229
  const type = diagramType || DEFAULT_DIAGRAM_TYPE;
230
230
  const ratio = aspectRatio || DEFAULT_ASPECT_RATIO;
231
231
  const alt = altText || DEFAULT_ALT_TEXT;
232
- return `<!-- DIAGRAM_IMAGE_START:${type}:${ratio}:${timestamp} -->\n![${alt}](${imagePath})\n<!-- DIAGRAM_IMAGE_END -->`;
232
+ const timestampPart = timestamp ? `:${timestamp}` : "";
233
+ return `<!-- DIAGRAM_IMAGE_START:${type}:${ratio}${timestampPart} -->\n![${alt}](${imagePath})\n<!-- DIAGRAM_IMAGE_END -->`;
233
234
  }
234
235
 
235
236
  const processedDocuments = new Set();